home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / comms / other / ums / developer / doc / ums.doc
Text File  |  1999-06-14  |  83KB  |  2,310 lines

  1. TABLE OF CONTENTS
  2.  
  3. ums.library/--background--
  4. ums.library/--loginguide--
  5. ums.library/--message-format--
  6. ums.library/--attributes--
  7. ums.library/UMSCannotExport
  8. ums.library/UMSDeleteMsg
  9. ums.library/UMSDupAccount
  10. ums.library/UMSErrNum
  11. ums.library/UMSErrTxt
  12. ums.library/UMSErrTxtFromNum
  13. ums.library/UMSExportedMsg
  14. ums.library/UMSFreeConfig
  15. ums.library/UMSFreeMsg
  16. ums.library/UMSLog
  17. ums.library/UMSLogin
  18. ums.library/UMSLogout
  19. ums.library/UMSMatchConfig
  20. ums.library/UMSReadConfig
  21. ums.library/UMSReadMsg
  22. ums.library/UMSRLogin
  23. ums.library/UMSSearch
  24. ums.library/UMSSelect
  25. ums.library/UMSServerControl
  26. ums.library/UMSWriteConfig
  27. ums.library/UMSWriteMsg
  28. ums.library/--background--                         ums.library/--background--
  29.  
  30.    $VER: 11.29 (11-Jun-95)
  31.  
  32.  
  33.    COPYRIGHT
  34.  
  35.          This document is (C) 1992-1995 by Martin Horneffer, Olaf Peters,
  36.        Christoph Viethen, and Stefan Becker.
  37.  
  38.          It may freely be copied and distributed, as long as the text  is
  39.        unchanged and this copyright notice is left intact.
  40.  
  41.    GENERAL
  42.          UMS stands for "Universal Message System".
  43.  
  44.          This means that UMS allows  to  treat  and  read  all  kinds  of
  45.        messages ('e-mail' and 'news') as universally and  efficiently  as
  46.        possible.
  47.  
  48.          The user should not need to care about what  network  a  message
  49.        comes from or goes to/through and what format is used, he  or  she
  50.        should be able to concentrate totally on the messages' contents.
  51.  
  52.          In order to achieve this goal, UMS does two things:
  53.  
  54.          1) define an universal format for messages where messages in all
  55.        formats and from all networks can be stored  in  without  loss  of
  56.        information and nevertheless being randomly interchangeable.
  57.  
  58.          This universal message format is described in this  document  in
  59.        section "--message-format--".
  60.  
  61.          2) implement a central, network-independent  database-mamagement
  62.        that allows to store and read/retrieve messages in the UMS  format
  63.        as efficiently as possible.
  64.  
  65.          The implementation of the  Message  Base  Processor  ('MBP')  is
  66.        based on the server/client- concept. Clients address the server to
  67.        get  or put messages. The server manages the storage and retrieval
  68.        of messages and controls the different client's  access-rights  to
  69.        the  system.  The  common interface between client and server is a
  70.        set of functions described in this document.
  71.  
  72.          Clients are
  73.  
  74.          - simple USERS that read  and  write  messages  (using  programs
  75.            called 'newsreaders'),
  76.          - a special kind of user,  the  'SYSOP',  which  has  additional
  77.            rights and tools to manage the system,
  78.          - IMPORTERS, that get messages form other systems and  put  them
  79.            into the local system after converting them to the UMS format,
  80.            and
  81.          - EXPORTERS, that look for all NEW messages in  the  system  and
  82.            send them to other systems  after  converting  them  into  the
  83.            specific format.
  84.  
  85.          The MBP controls which user may read what message  and,  in  the
  86.        same way, which exporter needs to export or forward what  message.
  87.        It  cares  about whether a message can or cannot be correctly sent
  88.        to its destination.
  89.  
  90.          The  MBP  also  performs  dupe-checking  and  reply-chaining  on
  91.        Message-IDs.
  92.  
  93.    TAGS
  94.          UMS extensively uses AmigaDOS-style tags (see: utility.library).
  95.        In addition to the AmigaDOS standard, UMS uses some bit-masking in
  96.        the types of tags:
  97.  
  98.          - if bit 13 is set (tag & 0x2000), the tag  data  is  a  STRPTR,
  99.            i.e. a pointer to a null-terminated string.
  100.          - if bit 14 is set (tag & 0x4000), the tag is considered a 'var-
  101.            parameter' (e.g. LONG *). I.e. the tag.data entry must contain
  102.            a  pointer  to the real data, which will be set/changed by the
  103.            called function.
  104.          - if both bits 13 and 14 are set ((tag &  0x6000)==0x6000),  the
  105.            tag is a pointer to a string pointer which will be set/changed
  106.            (STRPTR *).
  107.          - if none of these bits is set, the data  in  most  cases  is  a
  108.            simple integer parameter (e.g. LONG or  LONGBITS).  Exceptions
  109.            are possible and explicitly mentioned.
  110.  
  111. ums.library/--loginguide--
  112.  
  113.    PURPOSE
  114.        Guidelines on a uniform login-procedure in UMS-applications
  115.  
  116.    NOTE
  117.          Suggestions concerning this section of the  document  should  be
  118.        directed to Olaf Peters <op@hb2.maus.de>
  119.  
  120.    GENERAL
  121.          Shell- & Workbench-startup
  122.  
  123.          An  application  should  take  into  account  the  command  line
  124.        arguments  (Shell)  respectively   Workbench   tooltypes   'NAME',
  125.        'PASSWORD'  and  'SERVER'. Concerning invokation from a Shell, the
  126.        order of arguments  should  match  above  example,  with  'SERVER'
  127.        declared  a  keyword  (resulting  in  a command template beginning
  128.        "NAME,PASSWORD,SERVER/K[,...]").
  129.  
  130.    SHELL
  131.          Invocation from Shell:
  132.  
  133.          If the application is passed a questionmark as the only argument
  134.        on the command line  (i.e.  'UMSapp  ?'),  it  should  return  the
  135.        template  to  stdout and offer a prompt to have the user enter the
  136.        desired options. The user should be  able  to  request  additional
  137.        help  by  responding  to  the  prompt  with  another questionmark.
  138.        Additional help consists of complete version information (at least
  139.        a  standard version template as specified in "Amiga User Interface
  140.        Styleguide" (pp. 110)) accompanied by short help information.
  141.  
  142.          Technical realisation: DOS.ReadArgs() provides a standard  means
  143.        to parsing the command line  and  behaves  exactly  in  the  above
  144.        described  manner  (it  should therefore be used). Additional help
  145.        text can be passed to ReadArgs()  by  supplying  a  custom  RDArgs
  146.        structure  as  third  argument  which  holds a pointer to the text
  147.        string in RDA_ExtHelp. Refer to "The AmigaDOS Manual", Chapter  5,
  148.        Basic  Input and Output Programming, Standard Command Line Parsing
  149.        (pp. 181 as of the 3rd edition)
  150.  
  151.    GUI
  152.          Applications allowing login via GUI (graphical user interface):
  153.  
  154.          If 'NAME' is not specified at startup time, it must  be  entered
  155.        to the login window. Activate the name object.
  156.  
  157.          It is legal to pass an empty 'PASSWORD' as long  as  a  name  is
  158.        specified. Thus the empty password must attempt a  login!  If  the
  159.        user  passes  the period (".") as 'PASSWORD', she desires to enter
  160.        her password to the login window. It should open with the password
  161.        object activated.
  162.  
  163.          If there is no 'SERVER' specified and the login window  must  be
  164.        opened due to the above guidelines, the server  object  should  be
  165.        filled  with  the  name  of the default server (i.e. the server to
  166.        which the user would be going to log in to if she was not naming a
  167.        different one herself). The default server's name can be read from
  168.        the ENV $UMSSERVER. If the ENV does not exist, the default name is
  169.        "default". :-)
  170.  
  171.          A  failed  GUI  login  should  be answered in a requester. After
  172.        confirmation  the  user  should  be  presented with the unmodified
  173.        login  window again as to correct her wrong inputs. Cancelling the
  174.        requester should result in terminating the application.
  175.  
  176. ums.library/--message-format--                 ums.library/--message-format--
  177.  
  178.    NAME
  179.        UMS Message Format -- the universal format of UMS messages
  180.  
  181.    NOTE
  182.          Suggestions  concerning  this  section of the document should be
  183.        directed to Christoph Viethen <cv@nostlgic.oche.de>.
  184.  
  185.    GENERAL
  186.          A message in the UMS message base is always defined by a list of
  187.        tags.  This  allows  for  easy extension as new tags may always be
  188.        defined later on.
  189.  
  190.          In one UMS message, each tag may occur only once.
  191.  
  192.    TEXT TAGS
  193.          The  first  part  of  this  section  describes the format of the
  194.        currently  defined  TEXT-tags.  Currently  these  tags include all
  195.        information  that is site-independend and needed when transferring
  196.        messages between different systems.
  197.  
  198.          Except when explicitly stated otherwise, these tags are network-
  199.        independent.  Drivers  for  all  networks  can and must understand
  200.        them.
  201.  
  202.          A text-tag specifies a null-terminated string of any length. All
  203.        ASCII-characters  are allowed. Unless something else is documented
  204.        for  a specific tag, the standard Amiga charset (ISO 8859 Latin 1)
  205.        is used for 8-bit characters.
  206.  
  207.          Some of the text-tags are required for every message, others are
  208.        optional.
  209.  
  210.  
  211.      0. UMSCODE_MsgText
  212.  
  213.          This  contains  the main 'text' of a message. Every message must
  214.        have this tag as it is usually the main information transported by
  215.        a message.
  216.  
  217.          Any  information  that does not belong to the original text must
  218.        not  be  put  here.  Even  when  a  gateway  between two different
  219.        networks puts information in the text, an UMS importer should - if
  220.        possible  - extract this information and use or store it somewhere
  221.        else.
  222.  
  223.          The text may be of any size, even empty.
  224.  
  225.          By  using  the global ums.config item "Maxmsgsize" you can set a
  226.        size  limit.  Attempting to _write_ messages larger than this into
  227.        the  message  base will fail. (This limit does not affect the size
  228.        of  messages  already  in  the  message base. If you, say, write a
  229.        message  of  500K  into the MB and then set "Maxmsgsize" to 300000
  230.        (bytes), there shouldn't be any problems when making read accesses
  231.        to this message.)
  232.  
  233.          Since  some  networks  limit messages to a certain size, drivers
  234.        for these networks must be able to cope with this situation.
  235.  
  236.          Lines  are  delimited  by the standard line delimiter (LF in the
  237.        current  UMS implementation), no matter, what network the specific
  238.        messages  originate from and what kind of line delimiters are used
  239.        there.
  240.  
  241.          Lines  may  be  of  any  length, so it's up to the newsreader or
  242.        exporter to wrap lines if needed.
  243.  
  244.  
  245.      1. UMSCODE_FromName
  246.  
  247.          This is the name of the message's author. It's only the name and
  248.        NOT the address. This should be the REALNAME!
  249.  
  250.          If  there is no realname, the username must be used or extracted
  251.        from the author's address.
  252.  
  253.          Every message must have this tag.
  254.  
  255.  
  256.      2. UMSCODE_FromAddress
  257.  
  258.          This  is  the author's net-address. The name needn't redundantly
  259.        be repeated in this field, if it's already in UMSCODE_FromName.
  260.  
  261.          This  tag must be empty or the tag must not be specified, if the
  262.        author  is  located on the local system. In every other case, this
  263.        tag is mandatory.
  264.  
  265.          Whenever possible, the address should be the user's real address
  266.        and  not an encapsulated address or the address of a gateway. Thus
  267.        it may be necessary for importers to convert received addresses to
  268.        another  network's format. The corresponding exporters, of course,
  269.        have  to be able to re-convert these addresses. This makes the use
  270.        of  gateways  transparent to the user - one of UMS' most important
  271.        features.  It  saves  the user from having to know and worry about
  272.        the formats of all the gateways himself.
  273.  
  274.          Since  there  are  different  networks with different formats of
  275.        addresses, it's neccessary to distinguish these different formats.
  276.        This  is  done  by  looking  at  the  "tail"  of  the address. The
  277.        following formats are currently known:
  278.  
  279.  
  280.           Identifier                          : network/format
  281.           ----------------------------------------------------
  282.           "@Fidonet"                          : FidoNet
  283.           ".maus"                             : MausNet
  284.           ".org", ".edu", ".UUCP", ".net",
  285.           ".de", .. [any valid usenet domain] : RFC
  286.           "@BIX"                              : BIX
  287.           "@Portal"                           : Portal
  288.  
  289.  
  290.        Important note:
  291.  
  292.           Under certain circumstances, other identifiers may be used:
  293.  
  294.           1) Small networks: Quite a few of them use adresses which
  295.           look like FidoNet-Adresses, but contain a different "zone
  296.           number". For practical reasons, messages from such networks
  297.           may be imported into the UMS message base using an identifier
  298.           other than "@Fidonet". So you may encounter addresses like e.g.
  299.           "21:100/1.0@Gernet" in the MB.
  300.  
  301.           2) There are special-purpose applications, like e.g. QWK im-/
  302.           exporters(?), which could use other kinds of identifiers not
  303.           contained in the above table.
  304.  
  305.  
  306.          So  programmers of UMS applications should keep the following in
  307.        mind:
  308.  
  309.          Any UMS tool should be programmed in such a way that it does not
  310.        break if it encounters unknown network identifiers and/or formats.
  311.        In such cases, it should inform the user of the problem and behave
  312.        "neutrally", e.g. ignore the problematic message. UMS tools should
  313.        never  rely  on  somewhat  adventurous  "address  format guessing"
  314.        methods.
  315.  
  316.          On  the other hand, if you plan to write a tool that will import
  317.        messages  into  the  MB with address formats different to the ones
  318.        mentioned  in  the  above  table,  you  are  _strongly_ advised to
  319.        contact   authors   of  other  UMS  applications,  especially  the
  320.        developers   of   the   UMS   im-/exporters,  in  order  to  avoid
  321.        incompatibility problems right from the start.
  322.  
  323.  
  324.        Examples:
  325.  
  326.           a) Fidonet          2:2452/107.9@Fidonet
  327.                               2:242/53@Fidonet
  328.  
  329.           b) MausNet          AC2.maus
  330.                               MS.maus
  331.                               MK2.maus
  332.                               M.maus
  333.  
  334.           c) RFC              maho@dfv.rwth-aachen.de
  335.                               marvin@tornado.oche.de
  336.                               in-info@individual.net
  337.                               postmaster@germany.uucp
  338.                               peterk@cbmger.de.so.commodore.com
  339.  
  340.  
  341.          Network-identifiers  are  NOT  case-sensitive. Nevertheless, you
  342.        always  should  preserve  case,  as  it  might  be  needed by some
  343.        networks.
  344.  
  345.  
  346.        Historical note:
  347.  
  348.           Some time ago, a special address format was used in the
  349.           german "Z-Netz", and its identifier was ".zer". That format
  350.           had a number of limitations and disadvantages, so a new
  351.           mail format called "ZConnect" was developed and now should
  352.           be used by all Z-Netz members. This new format no longer
  353.           needs any special address identifiers since it uses real RFC
  354.           addresses.
  355.           So the identifier ".zer" mentioned in the V10 version of
  356.           this documentation shouldn't be treated in a special way
  357.           by programs using ums.library any more.
  358.  
  359.  
  360.        Some examples for splitting addresses for 'Name' and 'Address':
  361.  
  362.  
  363.        RFC:
  364.  
  365.           "Martin Horneffer <maho@umshq.dfv.rwth-aachen.de>"
  366.           -> name: "Martin Horneffer"
  367.              address: "maho@umshq.dfv.rwth-aachen.de"
  368.  
  369.           "horneff@pool.informatik.rwth-aachen.de (Martin Horneffer)"
  370.           -> name: "Martin Horneffer"
  371.              address: "horneff@pool.informatik.rwth-aachen.de"
  372.  
  373.           "horneff@pool.informatik.rwth-aachen.de"
  374.           -> name: "horneff"
  375.              address: "horneff@pool.informatik.rwth-aachen.de"
  376.  
  377.  
  378.        FidoNet:
  379.  
  380.           "Martin Horneffer at 2:242/7.9"
  381.           -> name: "Martin Horneffer"
  382.              address: "2:242/7.9@Fidonet"
  383.  
  384.           "Joerg Gutzke at 2:242/7"
  385.           -> name: "Joerg Gutzke"
  386.              address: "2:242/7@Fidonet"
  387.  
  388.  
  389.      3. UMSCODE_ToName
  390.  
  391.          Name of the person the message is addressed to.
  392.  
  393.          Must  be  specified  in  all  private messages ("e-mail") and is
  394.        optional in public messages ("news").
  395.  
  396.  
  397.      4. UMSCODE_ToAddress
  398.  
  399.          The addressed person's network address.
  400.  
  401.          Needed  in  private  messages if the message has not yet reached
  402.        its  destination. Must not be used when the mail is addressed to a
  403.        user on the local system.
  404.  
  405.          UMSCODE_ToName  and  UMSCODE_ToAddress  have  exactly  the  same
  406.        format as UMSCODE_FromName and UMSCODE_FromAddress.
  407.  
  408.          It  should  always  be  possible to reply to a private or public
  409.        message  by  using it's FromName and FromAddress as the new ToName
  410.        and ToAddress.
  411.  
  412.  
  413.      5. UMSCODE_MsgID
  414.  
  415.          A  unique  message  ID  in  RFC-format.  This  is valid also for
  416.        non-RFC networks like FidoNet or MausNet!
  417.  
  418.          Every  message  must  have  such  an  ID. If there's no ID for a
  419.        message, the message base processor will create a new one for this
  420.        message. Never create message IDs on your own!
  421.  
  422.          Some  example  message  ID's,  just to give you an idea what IDs
  423.        from RFC and non-RFC systems may look like within UMS:
  424.  
  425.  
  426.        2pocc6$qf2@Germany.EU.net
  427.        295@lyssa.owl.de                       (generated by RFC systems)
  428.  
  429.        91102312@p27.f107.n2452.z2.fidonet.org (generated by a Fido "point")
  430.        51515153@f7.n242.z2.fidonet.org        (generated by a  "non-point")
  431.  
  432.        199409281223.a27374@hro.maus.de        (generated in MausNet)
  433.  
  434.  
  435.      6. UMSCODE_CreationDate
  436.  
  437.          (Optional)  date  of  creation,  i.e.  when the message has been
  438.        written  by  the  user.  May  be in any format that is readable by
  439.        humans. AmigaDOS format (dd-mmm-yy hh:mm:ss) preferred.
  440.  
  441.          If not set, then the message base processor will use the current
  442.        date to create a date string in AmigaDOS format.
  443.  
  444.  
  445.      7. UMSCODE_ReceiveDate
  446.  
  447.          Obsolete.  Don't  use  any more! As a replacement there is a tag
  448.        for a site-specific binary date.
  449.  
  450.  
  451.      8. UMSCODE_ReferID
  452.  
  453.          (Optional)  message  ID  of  the  most  recent  message  that is
  454.        referred to by the current message. Same format as 'MsgID'.
  455.  
  456.  
  457.      9. UMSCODE_Group
  458.  
  459.          Name of the message's newsgroup.
  460.  
  461.          Must  be  used  for  public  messages only. Must not be used for
  462.        private  mail. This tag is the only one that distinguishes private
  463.        from public messages.
  464.  
  465.          To  avoid  possible  conflicts,  the name of the network must be
  466.        prepended  for  non-usenet  groupnames.  Usenet  groupnames, which
  467.        already are hierarchically ordered, stay as they are.
  468.  
  469.          E.g. "fidonet.AMIGA", "maus.ac.amiga", "comp.sys.amiga.misc".
  470.  
  471.          Only  one  group  may be used in this field! Use 'Hardlinks' for
  472.        "crosspostings".
  473.  
  474.  
  475.      10. UMSCODE_Subject
  476.  
  477.          The (short) subject of the message. Required.
  478.  
  479.  
  480.      11. UMSCODE_Attributes
  481.  
  482.          (Optional) List of keywords. See ums.library/--attributes--
  483.  
  484.  
  485.      12. UMSCODE_Comments
  486.  
  487.          (Optional)  all  "header-"information,  that belong to a message
  488.        and must be preserved, but don't fit to another text-tag. E.g. all
  489.        unknown RFC-header lines go here.
  490.  
  491.          The  first  line should specify the name of networks the message
  492.        comes from and the name (and perhaps version) of the importer.
  493.  
  494.  
  495.      13. UMSCODE_Organization
  496.  
  497.          (Optional) sender's organization or, in FidoNet, "Origin".
  498.  
  499.  
  500.      14. UMSCODE_Distribution
  501.  
  502.          (Optional)  where/what  the message should be distributed to/by.
  503.        Much like RFC-"Distribution:".
  504.  
  505.          Could  e.g.  be  used to select which UMS-Exporter should export
  506.        the respective message if the ums.config is set accordingly.
  507.  
  508.  
  509.      15. UMSCODE_Folder
  510.  
  511.          (Written  by receiver) The receiver of a private message may use
  512.        this  field  to  store  a  short  label in (not more than about 30
  513.        chars,  not  more  than  one  line). This allows him to categorize
  514.        received  messages. Newsreaders may allow to change that field for
  515.        private  messages  and  then  to use these categories or 'folders'
  516.        like 'groups' in public messages.
  517.  
  518.  
  519.      17. UMSCODE_MausID
  520.  
  521.          This is specific to MausNet.
  522.  
  523.          It  should  thus  be  ignored  by  all programs not specifically
  524.        dealing  with MausNet. It's used to store the internal MausNet-ID.
  525.        It  will  become  superfluous when MausNet software learns to deal
  526.        with real Message-IDs.
  527.  
  528.  
  529.      18. UMSCODE_ReplyGroup
  530.  
  531.          (Optional)  name  of  the  group  public  replies ("follow-ups")
  532.        should go to. Ergo: Same purpose as "Followup-To:" in RFC1036.
  533.  
  534.          If  not empty, newsreaders should copy this to the UMSCODE_Group
  535.        field  of  the  new  message  when  writing  a (public) follow-up.
  536.        Otherwise keep the old UMSCODE_Group field.
  537.  
  538.  
  539.          Same  format  as  for  field  UMSCODE_Group, except that, if the
  540.        author  of the public message thinks that public replies should go
  541.        into  several groups (as a "crossposting"), he may enter a list of
  542.        groups, seperated by commas, into this field.
  543.  
  544.  
  545.          Exception  to  all  of  this:  If this field contains the string
  546.        "poster", this expresses the poster's wish to get a private reply.
  547.        Newsreaders and similar UMS tools should behave accordingly.
  548.  
  549.  
  550.      19./20. UMSCODE_ReplyName/UMSCODE_ReplyAddress
  551.  
  552.          (Optional)  name  and address of the user private replies should
  553.        go to. Same purpose as "Reply-To:" in RFC822.
  554.  
  555.          If  not empty, newsreaders should copy these to the 'ToName' and
  556.        'ToAddress'-fields  of  the  new  message  when  writing a private
  557.        reply. Otherwise 'FromName' and 'FromAddress' should be used.
  558.  
  559.          Same format as for 'ToName' and 'ToAddress'.
  560.  
  561.  
  562.      21./22. UMSCODE_LogicalToName/UMSCODE_LogicalToAddress (V11)
  563.  
  564.          These  fields  are  needed  in UMS systems involved in automatic
  565.        mail distribution/forwarding, mailing lists e.g.
  566.  
  567.          Under  such  conditions,  it  may  be necessary to differenciate
  568.        between   "physical"   and  "logical"  addresses.  While  physical
  569.        addresses  describe  the  systems  messages are indeed transported
  570.        between,  logical  addresses  describe what origin and destination
  571.        the original author intended for his mail.
  572.  
  573.          If   these  fields  are  used,  the  fields  UMSCODE_ToName  and
  574.        UMSCODE_ToAddress contain the respective physical address.
  575.  
  576.          These fields are optional - and usually not needed.
  577.  
  578.  
  579.      23. UMSCODE_FileName (V11)
  580.  
  581.          (Optional) UMS supports the notion of  "attached files".  Binary
  582.        files may  be attached to each message. If so, this field contains
  583.        the logical names of all attached files. To get the separated file
  584.        names call UMSReadMsg with the tag RNextFileName  for  every  file.
  585.        No assumptions are  made  concerning  the  style  of  the  logical
  586.        filename.
  587.  
  588.          To attach more than one file to a message call UMSWriteMsg  with
  589.        one tag WFileName for every file.
  590.         
  591.  
  592.      24. UMSCODE_RFCMsgNum (V11)
  593.  
  594.          Private field for an NNTP daemon service or UUNEWS: emulator.
  595.  
  596.  
  597.      32. UMSCODE_FidoText
  598.  
  599.          This is specific to FidoNet.
  600.  
  601.          It  should  thus  be  ignored  by  all programs not specifically
  602.        dealing  with  FidoNet. It's used by FidoNet drivers to avoid loss
  603.        of informa- tion due to conversions of eol-delimiters or charsets.
  604.  
  605.  
  606.      33. UMSCODE_ErrorText
  607.  
  608.          This  is  private  to  the MBP and a very special utility called
  609.        'bounce-daemon'.  It is used to transfer an error-text for writing
  610.        bounce-mails.  No  programs  except  of the 'bounce-daemon' should
  611.        deal with it.
  612.  
  613.  
  614.      34. UMSCODE_Newsreader
  615.  
  616.          (Optional)  name and version of the tool the message was created
  617.        with.  No specific format, but should be as small as possible. Not
  618.        more than one line.
  619.  
  620.  
  621.      35. UMSCODE_RfcAttr
  622.  
  623.          Private  field for RFC exporters. The user can supply additional
  624.        information or hints to the exporter.
  625.  
  626.  
  627.      36. UMSCODE_FtnAttr
  628.  
  629.          Private  field for FTN exporters. The user can supply additional
  630.        information or hints to the exporter.
  631.  
  632.  
  633.      37. UMSCODE_ZerAttr
  634.  
  635.          Private   field  for  Z-Netz  exporters.  The  user  can  supply
  636.        additional information or hints to the exporter.
  637.  
  638.  
  639.      38. UMSCODE_MausAttr
  640.  
  641.          Private field for Maus exporters. The user can supply additional
  642.        information or hints to the exporter.
  643.  
  644.  
  645.      127. UMSCODE_TempFileName (V11)
  646.  
  647.          (Optional) This tag is related to UMSCODE_FileName. If files are
  648.        attached to the message, this field contains the "temporary" names
  649.        of the all attached files.  To get the separated file  names  call
  650.        UMSReadMsg with the tag  RNextTempFileName  for  every  file.  The
  651.        names have only a local meaning and may be different when  reading
  652.        and writing.
  653.  
  654.          When writing the message, the client must supply the  file  with
  655.        this temporary filename and the MBP must be able to  read  it.  To
  656.        attach more than one file to a message call UMSWriteMsg  with  one
  657.        tag WTempFileName for every file.
  658.  
  659.          When reading the message, the MBP supplies the name  to  a  file
  660.        the client may read.
  661.  
  662.          The contents of this field could be equal  to  UMSCODE_FileName,
  663.        but don't need to. Client as well as MBP have to use suitable path
  664.        in the filesystem, and specify the full pathname.
  665.  
  666. ums.library/--attributes--                         ums.library/--attributes--
  667.  
  668.    NOTE
  669.          Suggestions concerning this section of the document should be
  670.        directed to Stefan Becker <stefanb@yello.ping.de>.
  671.  
  672.    BUGS
  673.          This section is still in German. Should be English.
  674.  
  675.                                                               24-Sep-1994
  676.  
  677.                Das Format des UMS Feldes "Attributes"
  678.  
  679.          Das UMS Feld "Attributes" enthält zusätzliche  Informationen  zu
  680.        einer Nachricht. Diese Informationen  können  von  den  Importern,
  681.        aber  auch  von den Benutzern mit Hilfe der Message Reader erzeugt
  682.        werden. Ein Importer darf allerdings keine netzspezifischen  Daten
  683.        aus  der  Nachricht für den Exporter des gleichen Netzes in diesem
  684.        Feld ablegen. Dafür ist das Feld "Comments" vorgesehen.
  685.  
  686.          Dieser Text soll  das  Format  dieses  Feldes  vereinheitlichen,
  687.        damit das Feld von allen Programmen gleich ausgewertet  wird.  Das
  688.        Feld  besitzt  das  gleiche Format wie eine Kommandozeile, d.h. es
  689.        läßt sich mit Hilfe der Funktion dos.library/ReadArgs() auswerten.
  690.        Es sind folgende Argumenttypen zugelassen:
  691.  
  692.            /K   - Zeichenkette mit Schlüsselwort
  693.            /K/N - Zahl mit Schlüsselwort
  694.            /S   - Schalter mit Schlüsselwort
  695.  
  696.          Importer   können   private    Schlüsselworte    benutzen,    um
  697.        Informationen über den Status einer Nachricht an den Exporter  des
  698.        gleichen  Netzes  weiterzureichen.  Die  privaten  Schlüsselwörter
  699.        dürfen nicht mit den  öffentlichen  Schlüsselwörtern  kollidieren.
  700.        Damit  ein  Exporter für ihn unbekannte Schlüsselwörter ignorieren
  701.        kann,   hängt    er    ",IGNORE/M"    an    das    Template    für
  702.        dos.library/ReadArgs()  an.  Momentan  werden folgende öffentliche
  703.        Schlüsselworter unterstützt:
  704.  
  705.        ALIAS/K (nur lokal erzeugte Nachrichten)
  706.  
  707.            Die Zeichenkette gibt an, welchen Alias der Benutzer für diese
  708.          Nachricht benutzen möchte. Ein Exporter  _MUSS_  überprüfen,  ob
  709.          dieser  Alias  auch  zu  dem  Benutzer gehört, der die Nachricht
  710.          geschrieben hat!
  711.  
  712.        RECEIPT/S
  713.  
  714.            Dieses Attribut zeigt an, daß diese Nachricht eine Antwort auf
  715.          einen Receipt-Request ist.
  716.  
  717.        RECEIPT-REQUEST/K <addr>
  718.  
  719.            Für diese Nachricht liegt ein  Receipt-Request  des  Absenders
  720.          vor. Falls die Nachricht beim System des  Empfängers  angekommen
  721.          ist,  dann  sollte  der Importer eine Benachrichtigung an <addr>
  722.          zurückschicken.
  723.  
  724.        SECURE/S
  725.  
  726.            Wenn dieses Attribut gesetzt ist, dann soll die Nachricht  bei
  727.          der Übertragung besonders geschützt werden. Der Exporter  sollte
  728.          eine  gesicherte  Übertragungsstrecke  wählen. Falls diese nicht
  729.          zur   Verfügung   steht,   dann   sollte   der   Nachrichtentext
  730.          verschlüsselt  werden,  z.B. durch PGP mit den Empfängeradressen
  731.          als Parameter.
  732.  
  733.        URGENT/S
  734.  
  735.            Mit diesem  Attribut  werden  "eilige"  Nachrichten  markiert.
  736.          Exporter sollten, falls  möglich,  diese  Nachrichten  gesondert
  737.          behandeln.
  738.  
  739. ums.library/UMSCannotExport                       ums.library/UMSCannotExport
  740.  
  741.    NAME
  742.        UMSCannotExport -- Mark a message as not being exportable.
  743.  
  744.    SYNOPSIS
  745.        UMSCannotExport( login, msgNum, error )
  746.                          D2      D3     D4
  747.  
  748.        VOID UMSCannotExport( UMSAccount, LONG, STRPTR );
  749.  
  750.    FUNCTION
  751.          Tell the MBP that you cannot export this  message,  due  to  any
  752.        reason. The MBP will then look if other exporters still  could  be
  753.        able to export the message or do some error processing otherwise.
  754.  
  755.          It may use the supplied error-string therein. This  error-string
  756.        should be a  short  description  why  the  message  could  not  be
  757.        exported. By convention it should not be longer than 80 bytes.
  758.  
  759.    INPUTS
  760.        login  - Handle as returned by UMSLogin() or UMSRLogin()
  761.        msgNum - Number of the message.
  762.        error  - Short string (<80 chars).
  763.  
  764.    NOTES
  765.          This function may only be called by exporters.
  766.  
  767.          The MBP currently does not write a bounce mail to the author  of
  768.        the mail, but sets a  special  global  bit  instead,  which  would
  769.        allows the 'bouncer' tool to automatically write bounce mails.
  770.  
  771.    SEE ALSO
  772.        UMSExportedMsg()
  773.  
  774. ums.library/UMSDeleteMsg                             ums.library/UMSDeleteMsg
  775.  
  776.    NAME
  777.        UMSDeleteMsg -- Delete a message.
  778.  
  779.    SYNOPSIS
  780.        success = UMSDeleteMsg( login, msgNum )
  781.          D0                     D2      D3
  782.  
  783.        BOOL UMSDeleteMsg( UMSAccount, LONG);
  784.  
  785.    FUNCTION
  786.          This functions deletes a message, specified by number, from  the
  787.        UMS MB.
  788.  
  789.          It does not necessarily free space on the hd, but it removes the
  790.        message logically from the MB so that no other user can access  it
  791.        anymore and it won't affect the dupe-check for new messages.
  792.  
  793.          The MBP may need reorganization to physically  remove  logically
  794.        deleted messages.
  795.  
  796.    INPUTS
  797.        login   -  Handle as returned by UMSLogin() or UMSRLogin()
  798.        msgNum  -  Number  of  the  message to be deleted.  As returned by
  799.                   UMSSearch() or WriteUMSMsg().
  800.  
  801.    RESULT
  802.        success  -  Inidcates  whether the message was actually deleted or
  803.                    not.   It  will  be  not  deleted  if  you  don't have
  804.                    write-access  to  this  message or the message doesn't
  805.                    exist.
  806.  
  807.    NOTES
  808.          The number of a message is valid only as long as you are  logged
  809.        in. After UMSLogout() messages numbers may change!
  810.  
  811.          So you always have to use the  real  Message-ID  to  remember  a
  812.        message persistently.
  813.  
  814. ums.library/UMSDupAccount                           ums.library/UMSDupAccount
  815.  
  816.    NAME
  817.        UMSDupAccount -- share a login handle between processes
  818.  
  819.    SYNOPSIS
  820.        login = UMSDupAccount(login)
  821.        D0                      D2
  822.  
  823.        UMSAccount UMSDupAccount(UMSAccount);
  824.  
  825.    FUNCTION
  826.          UMSDupAccount() allows to  share  login  handles  to  be  shared
  827.        between different processes.
  828.  
  829.          A login handle as returned by UMSRlogin() may only  be  used  in
  830.        the same process that obtained the login. If it  wishes  to  share
  831.        this  login  with  other processes, the handle has to be 'dupped':
  832.        the login handle is passed to the new process,  which  may  _only_
  833.        use  this  login with UMSDupAccount(). If successfull, a new login
  834.        handle is returned, which (only!) can be used by the new process.
  835.  
  836.          This procedure is required to manage process-specific  resources
  837.        a login handle may depend on. It does _not_ create a new login  on
  838.        the  server.  Most likely, the server will not be involved in this
  839.        procedure at all, it's all done on the client side.  Each  process
  840.        must  UMSLogout()  all  login  handles  it  obtained  either  from
  841.        UMSRLogin() or from UMSDupAccount(). The  server  only  notices  a
  842.        logout,  when  all  login handles concerning that login are closed
  843.        with UMSLogout(). Order of login and  logout,  however,  does  not
  844.        matter.  E.g.  the  first  process  may UMSLogout() and terminate,
  845.        while the new process ist still running and using a  dupped  login
  846.        handle.  Obviously  the  login handle has to be active at the time
  847.        UMSDupAccount() is invoked, but  it  may  be  closed  as  soon  as
  848.        UMSDupAccount() has returned.
  849.  
  850.    INPUTS
  851.        login - Handle as returned by UMSLogin() or UMSRLogin()
  852.  
  853.    RESULT
  854.        login - Handle number if successful or Zero on failure
  855.  
  856.    SEE ALSO
  857.        UMSLogin(), UMSRLogin(), UMSLogout()
  858.  
  859. ums.library/UMSErrNum                                   ums.library/UMSErrNum
  860.  
  861.    NAME
  862.        UMSErrNum -- Return the number of the last error
  863.  
  864.    SYNOPSIS
  865.        error = UMSErrNum(login)
  866.        D0                D2
  867.  
  868.        UMSError UMSErrNum(UMSAccount);
  869.  
  870.    FUNCTION
  871.          UMS functions usually return zero to  indicate  an  error.  When
  872.        this happens, this routine may be called to get  a  more  specific
  873.        error  code.  By  some  means,  this routine corresponds to an UMS
  874.        login as dos.library/IoErr() does to a DOS-process.
  875.  
  876.          Possible UMS errors are:
  877.  
  878.        0:
  879.  
  880.            No error at all, the last UMS function call was successful.
  881.  
  882.        100-199:
  883.  
  884.            A slight error. The last functions call  was  not  successful,
  885.          but may succeed if some slight  changes  will  be  made  to  its
  886.          parameters.
  887.  
  888.        200-299:
  889.  
  890.            A real error. The last function call was not successful at all
  891.          and should not be retried.
  892.  
  893.        >300:
  894.  
  895.            A severe error concerning the whole system,  e.g.  the  server
  896.          has terminated. A program receiving such an error is recommended
  897.          to UMSLogout() and terminate as soon as possible.
  898.  
  899.    INPUTS
  900.        login - Handle as returned by UMSLogin() or UMSRLogin()
  901.  
  902.    RESULT
  903.        error - Error number
  904.  
  905.    SEE ALSO
  906.        UMSErrTxt()
  907.  
  908. ums.library/UMSErrTxt                                   ums.library/UMSErrTxt
  909.  
  910.    NAME
  911.        UMSErrTxt -- Return a string describing the last error
  912.  
  913.    SYNOPSIS
  914.        text = UMSErrTxt(login)
  915.        D0               D2
  916.  
  917.        STRPTR UMSErrTxt(UMSAccount);
  918.  
  919.    FUNCTION
  920.          When an UMS function fails and/or UMSErrNum() returns a  nonzero
  921.        value, you  should  use  this  routine  to  get  a  brief  English
  922.        description of the last error.
  923.  
  924.          Interactive programs should  display  this  text  to  the  user.
  925.        Non-interactive programs should use this text in their logfile.
  926.  
  927.    INPUTS
  928.        login - Handle as returned by UMSLogin() or UMSRLogin()
  929.  
  930.    RESULT
  931.        text - Pointer to a constant string
  932.  
  933.    NOTES
  934.          This is similiar to dos.library/Fault(), but it doesn't copy any
  935.        string, it just returns a pointer.
  936.  
  937.          You may NEVER change the string returned by UMSErrTxt()!
  938.  
  939.    SEE ALSO
  940.        UMSErrNum(), UMSErrTxtFromNum()
  941.  
  942. ums.library/UMSErrTxtFromNum                     ums.library/UMSErrTxtFromNum
  943.  
  944.    NAME
  945.        UMSErrTxtFromNum -- Return a string describing the last error
  946.  
  947.    SYNOPSIS
  948.        text = UMSErrTxtFromNum(error)
  949.        D0                      D2
  950.  
  951.        STRPTR UMSErrTxtFromNum(UMSError);
  952.  
  953.    FUNCTION
  954.          When an UMS function not related to  an  UMSAccount  returns  an
  955.        nonzero value, you should use this routine to get a brief  English
  956.        description of the last error.
  957.  
  958.          Interactive programs should  display  this  text  to  the  user.
  959.        Non-interactive programs should use this text in their logfile.
  960.  
  961.    INPUTS
  962.        error - UMS error code
  963.  
  964.    RESULT
  965.        text - Pointer to a constant string
  966.  
  967.    NOTES
  968.          This is similiar to dos.library/Fault(), but it doesn't copy any
  969.        string, it just returns a pointer.
  970.  
  971.          You may NEVER change the string returned by UMSErrTxtFromNum()!
  972.  
  973.    SEE ALSO
  974.        UMSErrTxt()
  975.  
  976. ums.library/UMSExportedMsg                         ums.library/UMSExportedMsg
  977.  
  978.    NAME
  979.        UMSExportedMsg -- Mark a message as being successfully exported.
  980.  
  981.    SYNOPSIS
  982.        UMSExportedMsg( login, msgNum )
  983.                         D2      D3
  984.  
  985.        VOID UMSExportedMsg( UMSAccount, LONG );
  986.  
  987.    FUNCTION
  988.          Tells the MBP that a message has been successfully exported. The
  989.        MBP uses this information to prevent other exporters from  wrongly
  990.        exporting this message a second time or writing a bounce message.
  991.  
  992.          Every exporter that exports a message from the local UMS  system
  993.        to any other system or network MUST call  either  UMSExportedMsg()
  994.        or  UMSCannotExport()  for  each message it has processed. This is
  995.        valid for private messages as well as for public messages  (news).
  996.        The MBP will decide what has to be done in any of these cases.
  997.  
  998.    INPUTS
  999.        msgNum - Number of the exported message.
  1000.  
  1001.    NOTES
  1002.          This function may only be called by exporters.
  1003.  
  1004.    SEE ALSO
  1005.        UMSCannotExport()
  1006.  
  1007. ums.library/UMSFreeConfig                           ums.library/UMSFreeConfig
  1008.  
  1009.    NAME
  1010.  
  1011.        UMSFreeConfig - Free a string returned by UMSReadConfig()
  1012.  
  1013.    SYNOPSIS
  1014.  
  1015.        UMSFreeConfig( login, string)
  1016.                        D2      D3
  1017.  
  1018.        void UMSFreeConfig( UMSAccount, STRPTR );
  1019.  
  1020.    FUNCTION
  1021.          Frees  the  buffer  allocated  for  a  string  and  returned  by
  1022.        UMSReadConfig(). After 'UMSFreeConfig(string)', 'string'  will  no
  1023.        longer be valid.
  1024.  
  1025.    INPUTS
  1026.        login  - Handle as returned by UMSLogin() or UMSRLogin()
  1027.        string - string to be freed as returned by UMSReadConfig()
  1028.  
  1029.    SEE ALSO
  1030.        UMSReadConfig()
  1031.  
  1032. ums.library/UMSFreeMsg                                 ums.library/UMSFreeMsg
  1033.  
  1034.    NAME
  1035.        UMSFreeMsg -- Free buffers associated with a certain message.
  1036.  
  1037.    SYNOPSIS
  1038.        UMSFreeMsg( login, msgNum )
  1039.                     D2      D3
  1040.  
  1041.        UMSFreeMsg( UMSAccount, LONG );
  1042.  
  1043.    FUNCTION
  1044.          Frees  all  the  buffers  associated  with  a  certain  message.
  1045.        ReadUMSMsg() allocates the buffers, this function frees them.
  1046.  
  1047.    INPUTS
  1048.        msgNum - number of the message previously read with ReadUMSMsg().
  1049.  
  1050.    NOTES
  1051.          With UMSFreeMsg() all STRPTRs obtained  with  ReadUMSMsg()  that
  1052.        are concerned with this certain message become  invalid.  You  can
  1053.        have  multiple  ReadUMSMsg()  on  the  same  message  but only one
  1054.        UMSFreeMsg().
  1055.  
  1056.    SEE ALSO
  1057.        UMSReadMsg()
  1058.  
  1059. ums.library/UMSLog                                         ums.library/UMSLog
  1060.  
  1061.    NAME
  1062.        UMSLog -- Write an entry to the global UMS logfile
  1063.  
  1064.    SYNOPSIS
  1065.        UMSLog(login, level, format, ...)
  1066.               D2     D4     D5      D6
  1067.  
  1068.        void UMSLog(UMSAccount, LONG, STRPTR, ... );
  1069.  
  1070.        UMSVLog(login, level, format, args)
  1071.                 D2    D4      D5     D6
  1072.  
  1073.        void UMSVLog(UMSAccount, LONG, STRPTR, APTR);
  1074.  
  1075.    FUNCTION
  1076.          Write a short message to the UMS logfile,  doing  printf()-style
  1077.        formatting on supplied parameters.
  1078.  
  1079.          Rather than creating its own logfile, an application should  use
  1080.        this function to report its actions and/or errors. This  makes  it
  1081.        easier for the user to get an overview on what is happening in his
  1082.        system - he only has to look in ONE logfile.
  1083.  
  1084.          UMSLog() uses a 'level' parameter to decide  whether  a  message
  1085.        should actually be written to the logfile or be ignored. The lower
  1086.        this  number,  the  more  important  is  the message. Choose it as
  1087.        follows:
  1088.  
  1089.        1-4:
  1090.  
  1091.            An ERROR. 1 = fatal error, 4 = recoverable error.
  1092.  
  1093.        5-7:
  1094.  
  1095.            General information or report.
  1096.  
  1097.        8-9:
  1098.  
  1099.            Information that is not useful for normal operation, but  used
  1100.          for debugging purposes.
  1101.  
  1102.          Of course messages with high level  values  should  appear  more
  1103.        frequently than those with low level values.
  1104.  
  1105.    INPUTS
  1106.        login  - Handle as returned by UMSLogin() or UMSRLogin()
  1107.        level  - Number between 1 and 9
  1108.        format - printf()-style format string. See exec.library/RawDoFmt()
  1109.                 for more information on formatting.
  1110.        args   - Arguments for the format string
  1111.  
  1112.    SEE ALSO
  1113.        exec.library/RawDoFmt()
  1114.  
  1115. ums.library/UMSLogin                                     ums.library/UMSLogin
  1116.  
  1117.    NAME
  1118.        UMSLogin -- Obtain a login for access to the default message base
  1119.  
  1120.    SYNOPSIS
  1121.        login = UMSLogin(user, passwd)
  1122.        D0               D2    D3
  1123.  
  1124.        UMSAccount UMSLogin(STRPTR, STRPTR);
  1125.  
  1126.    FUNCTION
  1127.          This function does the  same  as  UMSRLogin(),  but  you  cannot
  1128.        specify the message base. The default message base  will  be  used
  1129.        instead.
  1130.  
  1131.    INPUTS
  1132.        user   - Name or 'alias' of an user
  1133.        passwd - The password of the user. A pointer to the null-string is
  1134.                 allowed, NULL itself isn't.
  1135.  
  1136.    RESULT
  1137.        login  - Handle number if successful or Zero on failure
  1138.  
  1139.    EXAMPLE
  1140.        UMSAccount login = UMSLogin("SysOp", "secret");
  1141.  
  1142.    NOTE
  1143.          Never forget to call UMSLogout()!
  1144.  
  1145.          New programs should let the user specify the server to  use  and
  1146.        thus use UMSRLogin() instead.
  1147.  
  1148.    SEE ALSO
  1149.        UMSLogout(), UMSRLogin()
  1150.  
  1151. ums.library/UMSLogout                                   ums.library/UMSLogout
  1152.  
  1153.    NAME
  1154.        UMSLogout -- Close a login and free its resources
  1155.  
  1156.    SYNOPSIS
  1157.        UMSLogout(login)
  1158.                  D2
  1159.  
  1160.        void UMSLogout(UMSAccount);
  1161.  
  1162.    FUNCTION
  1163.          Close a login obtained with UMSRLogin()  and  free  all  related
  1164.        resources.
  1165.  
  1166.    INPUTS
  1167.        login - Handle as returned by UMSLogin() or UMSRLogin()
  1168.  
  1169.    SEE ALSO
  1170.        UMSLogin(), UMSRLogin()
  1171.  
  1172. ums.library/UMSMatchConfig                         ums.library/UMSMatchConfig
  1173.  
  1174.    NAME
  1175.        UMSMatchConfig -- Match a string against a config string.
  1176.  
  1177.    SYNOPSIS
  1178.        match = UMSMatchConfig( login, tags )
  1179.          D0                     D2     D3
  1180.  
  1181.        BOOL UMSMatchConfig( UMSAccount, struct TagItem * );
  1182.  
  1183.        match = UMSMatchConfigTags( login, tag1, ... )
  1184.  
  1185.        BOOL UMSMatchConfigTags( UMSAccount, ULONG, ... );
  1186.  
  1187.  
  1188.    FUNCTION
  1189.          UMS has its unique mechanism for pattern-matching, which is used
  1190.        by the MBP for determining different access-rights.
  1191.  
  1192.          UMSMatchConfig() offers direct access to  this  pattern-matching
  1193.        mechanism, including positive and  negative  config  variables.  A
  1194.        taglist  is  used to specify the string to be matched as well as a
  1195.        UMS configuriation string serving as a pattern.
  1196.  
  1197.    INPUTS
  1198.          The functions takes two mandatory tags:
  1199.  
  1200.        MatchString (STRPTR)
  1201.  
  1202.            specifies the string to be matched.
  1203.  
  1204.        MatchVarname (STRPTR)
  1205.  
  1206.            specifies the name of the UMS config string.
  1207.  
  1208.          And there are some optional tags:
  1209.  
  1210.        MatchGlobalOnly (none)
  1211.  
  1212.            only use a global config string.
  1213.  
  1214.        MatchUser (STRPTR)
  1215.  
  1216.            use a config string local to another user. The name (or alias)
  1217.          of that user must be given.
  1218.  
  1219.        MatchDefault (LONG)
  1220.  
  1221.            a value that will be returned, if the specified config  string
  1222.          cannot be found, or any other type of error occurs.
  1223.  
  1224.    RESULT
  1225.        match - the result of the pattern matching. The value of tag
  1226.                MatchDefault or zero if an error occured.
  1227.  
  1228.    SEE ALSO
  1229.        UMSReadConfig()
  1230.  
  1231. ums.library/UMSReadConfig                           ums.library/UMSReadConfig
  1232.  
  1233.    NAME
  1234.        UMSReadConfig -- Read an element from UMS' configuration.
  1235.  
  1236.    SYNOPSIS
  1237.        string = UMSReadConfig( login, tags )
  1238.          D0                     D2     D3
  1239.  
  1240.        STRPTR UMSReadConfig( UMSAccount, struct TagItem * );
  1241.  
  1242.        string = UMSReadConfigTags( login, tag1, ... )
  1243.  
  1244.        STRPTR UMSReadConfigTags( UMSAccount, ULONG, ... );
  1245.  
  1246.  
  1247.    FUNCTION
  1248.          Read an object from UMS' configuration.
  1249.  
  1250.          Whenever possible, applications should use the UMS configuration
  1251.        (as stored in the  file  'ums.config'  in  the  directory  of  the
  1252.        message-base)  and  the  supplied  functions  UMSReadConfig()  and
  1253.        UMSWriteConfig() instead of own special config-files.
  1254.  
  1255.          A 'config-string' is a null-terminated string identified  by  an
  1256.        unique  name.  Similar   to   shell-   and   environment-variables
  1257.        config-strings  can  be global (same for all users) or local (only
  1258.        visible to a certain user).
  1259.  
  1260.          Other  config-objects  are  'users'  (with  aliases  and   local
  1261.        strings), 'akas' and 'netgroups'.
  1262.  
  1263.          In order not to mix up config-strings of different applications,
  1264.        their names should have the  id  of  the  application  and  a  dot
  1265.        prepended.  E.g.  "fido.outbound", "fido.inbound", "uucp.uuspool",
  1266.        "IntuiNews.QuoteChars.foo.bar", "ConfUMS.ForceDelete" etc.
  1267.  
  1268.          Names without a dot (".") are considered private strings of  the
  1269.        MBP, e.g. "READACCESS", "WRITEACCESS".
  1270.  
  1271.          Names for config elements are case-insensitive.
  1272.  
  1273.          This function buffers the returned string until it is freed with
  1274.        UMSFreeConfig() or (UMSLogout()).
  1275.  
  1276.    INPUTS
  1277.          The following tags are allowed:
  1278.  
  1279.        CfgGlobalOnly (none)
  1280.  
  1281.            read just global config-elements, ignore local ones.
  1282.  
  1283.        CfgUser (STRPTR)
  1284.  
  1285.            read config elements local to another user. You  must  specify
  1286.          the name of the other user here. This contradicts  CfgGlobalOnly
  1287.          (see above)!
  1288.  
  1289.        CfgLockVar (LONG, V11)
  1290.  
  1291.            using this tag you may preserve the config string  from  being
  1292.          modified by another login, i.e. another  UMS  program.  Set  the
  1293.          tag's data to 1 if you want to do so, otherwise use 0 (or do not
  1294.          use this tag) to not lock the variable. Be careful to unlock the
  1295.          variable  if you do not need it anymore using UMSWriteConfig()'s
  1296.          tags CfgUnlockVar! This tag is useful only in  conjunction  with
  1297.          CfgName (see below).
  1298.  
  1299.        CfgQuoted (LONG, V11)
  1300.  
  1301.            read the variable in quoted format, as used  in  "ums.config".
  1302.          This enables you to mix the variable's data with macros. Set the
  1303.          tag's  data to 1 if you want to use the quoted format, otherwise
  1304.          set it to 0 (or do not use this tag).
  1305.  
  1306.  
  1307.          The following tags are mutually exclusive. Use  exactly  one  of
  1308.        them.
  1309.  
  1310.          The CfgNext-tags allow you to scan all the existing elements  of
  1311.        one type and do all work in the same manner: On  first  invocation
  1312.        you  set  the  tag's  data to NULL and get the first element. With
  1313.        every further call, you set it to what has been  returned  on  the
  1314.        previous call. When NULL is returned, you're done.
  1315.  
  1316.        CfgName (STRPTR)
  1317.  
  1318.            read a config-string with given name.
  1319.  
  1320.        CfgUserName (STRPTR)
  1321.  
  1322.            get the 'realname' for a user with a given alias.
  1323.  
  1324.        CfgNextVar (STRPTR)
  1325.  
  1326.            get the name of the next config variable.  This  tag  must  be
  1327.          combined with tag CfgGlobalOnly or tag CfgUser (see above).
  1328.  
  1329.        CfgNextAlias (STRPTR, V11)
  1330.  
  1331.            get the next alias. This tags may  be  combined  with  CfgUser
  1332.          (see above)
  1333.  
  1334.        CfgNextUser (STRPTR, V11)
  1335.  
  1336.            get the 'realname' of the next user.
  1337.  
  1338.        CfgNextExporter (STRPTR, V11)
  1339.  
  1340.            get the name of the next exporter.
  1341.  
  1342.        CfgNextGroup (STRPTR)
  1343.  
  1344.            get the name of the next netgroup. Any  number  of  groupnames
  1345.          may be configured as identical 'netgroups'. Use this tag to scan
  1346.          all netgroups, to scan their members use CfgNextGroupMember (see
  1347.          below).
  1348.  
  1349.        CfgNextGroupMember (STRPTR, V11)
  1350.  
  1351.            get the name of the next member of a specific netgroup.  Using
  1352.          this tag repeatedly you can cycle trough all groups belonging to
  1353.          the  same  netgroup.  Members  of  netgroups  are organized in a
  1354.          circular structure, so  you'll  have  to  compare  the  original
  1355.          string  with every result to determine whether you're done. NULL
  1356.          is returned only if the given string doesn't  indicate  a  valid
  1357.          netgroup-member.
  1358.  
  1359.    RESULT
  1360.        string - a pointer to the desired config element or NULL.
  1361.  
  1362.    SEE ALSO
  1363.        UMSFreeConfig(), UMSWriteConfig()
  1364.  
  1365. ums.library/UMSReadMsg                                 ums.library/UMSReadMsg
  1366.  
  1367.    NAME
  1368.        UMSReadMsg -- Read (parts of) a message.
  1369.  
  1370.    SYNOPSIS
  1371.        success = UMSReadMsg( login, tags )
  1372.          D0                   D2     D3
  1373.  
  1374.        BOOL UMSReadMsg( UMSAccount, struct TagItem * );
  1375.  
  1376.        success = UMSReadMsgTags( login, tag1, ... )
  1377.  
  1378.        BOOL UMSReadMsgTags( UMSAccount, ULONG, ... );
  1379.  
  1380.    FUNCTION
  1381.          Read a message or any parts of it.
  1382.  
  1383.    INPUTS
  1384.          The following tags are allowed:
  1385.  
  1386.        RMsgNum (LONG)
  1387.  
  1388.            specify which msg to read. This tag MUST be used!
  1389.  
  1390.        RHeaderLength (LONG*)
  1391.  
  1392.            you have to pass a pointer to a LONG here. This LONG  will  be
  1393.          set to the length of  the  message-header  in  bytes.  I.e.  the
  1394.          length  of  all text-fields considered to belong to the 'header'
  1395.          of a message.
  1396.  
  1397.        RTextLength (LONG*)
  1398.  
  1399.            like RHeaderLength, but the length of the message-text.  These
  1400.          are all other fields.
  1401.  
  1402.        RMsgDate (LONG*)
  1403.  
  1404.            the date the message has  been  written  to  the  message-base
  1405.          (also referred to as the  'receive-date').  In  AmigaDOS  Format
  1406.          (seconds since 1.1.1978).
  1407.  
  1408.        RChainUp,
  1409.        RChainDn,
  1410.        RChainLt,
  1411.        RChainRt (LONG*)
  1412.  
  1413.            reply-chaining. Since a message can only refer  to  one  other
  1414.          (older)  message,  but  have  multiple  other  (newer)  messages
  1415.          referring to it, a tree is built out of this 'comment-chaining'.
  1416.          ChainUp points to the referred message. ChainDn points to one of
  1417.          the  messages  that  comment  on  the  current  one. ChainLt and
  1418.          ChainRt point to other messages which share the same ChainUp.
  1419.  
  1420.            The LONG you supply a pointer to in the tag's data will either
  1421.          be set to zero (when there is no such chain) or to the number of
  1422.          a message.
  1423.  
  1424.        RGlobalFlags (LONGBITS*)
  1425.  
  1426.            global flags for this message. In the  MB  every  message  has
  1427.          exactly one set of global flags. See <ums.h> for the meaning  of
  1428.          these flags.
  1429.  
  1430.        RUserFlags (LONGBITS*)
  1431.  
  1432.            user-flags for this message. Every user of the MB has one  set
  1433.          of user-flags for each message. See <ums.h>  for  the  fixed  or
  1434.          suggested meanings of these flags.
  1435.  
  1436.        RLoginFlags (LONGBITS*)
  1437.  
  1438.            login-flags for this message. Every login has a private set of
  1439.          flags for each message. In contrast  to  global  or  user-flags,
  1440.          login-flags  are  NOT  saved and vanish on UMSLogout(). They are
  1441.          set to zero on UMSLogin().
  1442.  
  1443.        RHardLink,
  1444.        RSoftLink (LONG*)
  1445.  
  1446.            you supply a pointer to a LONG that will be set to the message
  1447.          number of the next hard- or softlink in the circular linked list
  1448.          of messages. The LONG will be set to zero, if there are no links
  1449.          of the respective type to this message. Note that  message-links
  1450.          can  either  be  hard  or soft, but not both a the same time! So
  1451.          only one of HardLink or SoftLink can be non-zero.
  1452.  
  1453.        RDateStyle (LONG)
  1454.  
  1455.            use this tag and set its data to 1  if  you  want  to  get  an
  1456.          old-style 'receive-date'. Don't use this tag or set its data  to
  1457.          zero otherwise.
  1458.  
  1459.        RMsgText, ..
  1460.        RMsgText + 127 (STRPTR*)
  1461.  
  1462.            tell UMS that you want to read the  specified  text-field  and
  1463.          supply a place for a pointer to it. This will be set to NULL  if
  1464.          the field doesn't exist or you're not allowed to read it.
  1465.  
  1466.        RTextFields (UMSMsgTextFields)
  1467.  
  1468.            if you supply a pointer to an  array  of  UMSNUMFIELDS  STRPTR
  1469.          here, it will be set to the read text-fields. Useful for reading
  1470.          a  whole  message  without  having  to  specify  a  tag for each
  1471.          possible text-field.
  1472.  
  1473.        RReadHeader (none)
  1474.  
  1475.            tell UMS that you want to read  all  header-field.  Useful  in
  1476.          combination with RTextFields only.
  1477.  
  1478.        RReadAll (none)
  1479.  
  1480.            tell UMS that you want to read the message-text,  too.  Useful
  1481.          in combination with RTextFields only.
  1482.  
  1483.          The following tag  was  not  implemented  in  ums.library  until
  1484.        V9.70!
  1485.  
  1486.        RIDStyle (LONG)
  1487.  
  1488.            choose the style of local message IDs. There are two  possible
  1489.          formats of 'local' message IDs (= the IDs created by  the  local
  1490.          system):
  1491.  
  1492.              a) a simple decimal number  that  is  unique  on  the  local
  1493.                 system
  1494.  
  1495.              b) this decimal number  followed  by  "@"  and  the  domain-
  1496.                 address  of  the  local  system.   This   conforms   with
  1497.                 RFC822/1036.
  1498.  
  1499.            Old (obsolete) Version of  ums.library  (<  V9.70)  still  use
  1500.          format a), but since V9.70 versions use format b)  in  order  to
  1501.          make  things  cleaner  and  make life easier for exporters. With
  1502.          format a)  exporters  must  append  the  domain-address  to  IDs
  1503.          themselves, with format b) they needn't care about whether an ID
  1504.          is local or not.
  1505.  
  1506.            As an interim solution this tag allows to specify the  desired
  1507.          format. Its data set to 1 forces format a), 0  (default)  forces
  1508.          format b).
  1509.  
  1510.        RNoUpdate (LONG)
  1511.  
  1512.            when reading its message-text, a message is usually updated by
  1513.          having its 'Old'-flag set in your user-status. If you don't want
  1514.          the Old-flag to be set, use this tag and set its data to 1.
  1515.  
  1516.        RNextFileName,
  1517.        RNextTempFileName (STRPTR*)
  1518.  
  1519.          These tags allow you to scan all existing elements of the  field
  1520.        UMSCODE_FileName or UMSCODE_TempFileName. On first invocation  you
  1521.        set the tag's data to NULL and get the first element.  With  every
  1522.        further call, you set it to what has been returned on the previous
  1523.        call. When NULL is returned, you're done.
  1524.  
  1525.    RESULT
  1526.        success - whether your attempt to read the message was  successful
  1527.                  or not.
  1528.  
  1529.    NOTES
  1530.          The message will be buffered, so you  can  easily  use  all  the
  1531.        returned STRPTRs. You have to use UMSFreeMsg() to free the buffers
  1532.        allocated for a certain message.
  1533.  
  1534.          The string obtained by UMSReadMsg() are private copies for you -
  1535.        though not recommended, you may even overwrite them,  but  _never_
  1536.        beyond  the  teminating  zero-byte.  UMSFreeMsg()  still  wroks if
  1537.        strings are modified.
  1538.  
  1539.          An user or exporter usually wants to read a single message  only
  1540.        once.
  1541.  
  1542.          To make this easy, UMSReadMsg() checks whether  the  user  reads
  1543.        the 'MsgText' of a message, and, if so, sets the 'Old'-Flag in the
  1544.        users status if it wasn't already set.
  1545.  
  1546.          So the user (or exporter) only needs to ask for this flag to  be
  1547.        unset when using  'UMSSearch()'  before  'UMSReadMsg()'  and  will
  1548.        automatically avoid reading the same message a second time.
  1549.  
  1550.    SEE ALSO
  1551.        UMSFreeMsg(), UMSSearch()
  1552.  
  1553. ums.library/UMSRLogin                                   ums.library/UMSRLogin
  1554.  
  1555.    NAME
  1556.        UMSRLogin -- Obtain a login for access to a message base
  1557.  
  1558.    SYNOPSIS
  1559.        login = UMSRLogin(server, user, passwd)
  1560.        D0                D2      D3    D4
  1561.  
  1562.        UMSAccount UMSRLogin(STRPTR, STRPTR, STRPTR);
  1563.  
  1564.    FUNCTION
  1565.  
  1566.          This function is used to get access to an UMS message  base.  If
  1567.        necessary the UMSServer is launched first.
  1568.  
  1569.          This function returns a handle which is used internally to track
  1570.        and remember the resources associated with each login. If an  user
  1571.        tries  to  login multiple times this handle will be different each
  1572.        time. A login may be used only by the  process  which  created  it
  1573.        UMSRLogin(). Zero on failure, any other value indicates success.
  1574.  
  1575.    INPUTS
  1576.        server - Name of the message base
  1577.        user   - Name or 'alias' of an user
  1578.        passwd - The password of the user. A pointer to the null-string is
  1579.                 allowed, NULL itself isn't.
  1580.  
  1581.    RESULT
  1582.        login  - Handle number if successful or Zero on failure
  1583.  
  1584.  
  1585.    EXAMPLE
  1586.        UMSAccount login = UMSRLogin("TestServer", "SysOp", "secret");
  1587.  
  1588.    NOTE
  1589.          Never forget to call UMSLogout()!
  1590.  
  1591.          Use this function instead of UMSLogin() for new programms.
  1592.  
  1593.    SEE ALSO
  1594.        UMSLogin(), UMSLogout()
  1595.  
  1596. ums.library/UMSSearch                                   ums.library/UMSSearch
  1597.  
  1598.    NAME
  1599.        UMSSearch -- Search a message from the MB.
  1600.  
  1601.    SYNOPSIS
  1602.        msgNum = UMSSearch( login, tags )
  1603.          D0                 D2     D3
  1604.  
  1605.        LONG UMSSearch( UMSAccount, struct TagItem * );
  1606.  
  1607.        msgNum = UMSSearchTags( login, tag1, ... )
  1608.  
  1609.        LONG UMSSearchTags( UMSAccount, ULONG, ... );
  1610.  
  1611.    FUNCTION
  1612.          Search  the  first  (or  next)  message  in  the MB that fulfils
  1613.        certain criteria.
  1614.  
  1615.          When  you  want  to  read  certain  messages  from the MB, it is
  1616.        recommended that you first select these  messages with UMSSelect()
  1617.        and  then  alternately  use  UMSSearch()  and UMSRead() to get all
  1618.        these messages.
  1619.  
  1620.    INPUTS
  1621.          Allowed tags:
  1622.  
  1623.        SearchLast (LONG)
  1624.  
  1625.            specify the last message NOT to search. This tag allows you to
  1626.          cycle trough all messages fullfilling  the  same  criteria:  set
  1627.          this  to  zero  and invoke UMSSearch() the first time. Check the
  1628.          result and if it's not zero, put  it  in  this  tag  and  invoke
  1629.          UMSSearch() again. Repeat this until it returns zero.
  1630.  
  1631.        SearchDirection (LONG)
  1632.  
  1633.            set the search direction. 1 means search  forward  (to  higher
  1634.          numbers), -1 means search backwards (to  lower  numbers)  and  0
  1635.          lets  the  MBP  decide  what  sequence  to  use. This needn't be
  1636.          exactly forwards or backwards.  It  might  be  in  a  completely
  1637.          different order.
  1638.  
  1639.            When you don't depend on a certain search-direction, use 0  or
  1640.          omit this tag.
  1641.  
  1642.        SearchGlobal (none)
  1643.        SearchLocal  (none)
  1644.        SearchUser   (STRPTR)
  1645.        SearchMask   (LONGBITS)
  1646.        SearchMatch  (LONGBITS)
  1647.  
  1648.            search   for   a   matching   status;   like    SelReadGlobal,
  1649.          SelReadLocal,   SelReadUser,   SelMask   and    SelMatch    with
  1650.          UMSSelect().
  1651.  
  1652.        WMsgText, ..
  1653.        WMsgText + 127 (STRPTR)
  1654.  
  1655.            search for a matching text; as for UMSSelect(). Only one field
  1656.          can be searched for at a time.
  1657.  
  1658.        SearchQuick (none)
  1659.  
  1660.            Enable 'quick-search'. This must be combined with exactly  one
  1661.          of WMsgText+1 .. WMsgText+31. quick-searches  are  possible  for
  1662.          exact  string  searches  only,  they  must  not be combined with
  1663.          patterns and they are only possible  for  fields  that  have  an
  1664.          index.
  1665.  
  1666.            They  don't  guarantee  that  the  returned  message's   field
  1667.          actually matches the given string,  altough  mistakes  are  very
  1668.          unlikely.
  1669.  
  1670.            But they are fast! (see NOTES below)
  1671.  
  1672.        SearchPattern (LONG)
  1673.  
  1674.            indicate whether the string to be searched  for  is  an  exact
  1675.          string (0), an AmigaDOS pattern (1) or UMS should  try  to  find
  1676.          out (2).
  1677.  
  1678.    RESULT
  1679.        msgNum - numer of a/the searched message; zero if not found.
  1680.  
  1681.    NOTES
  1682.          Although  LONGBITS  are  used  in  the  definition,  the current
  1683.        implementation only uses/supports the lower 16 bits.
  1684.  
  1685.          Performance:   when  searching  for  strings, different calls to
  1686.        UMSSearch()  may  significantly  vary  in  performance.  There are
  1687.        three general possibilities:
  1688.  
  1689.          1) quick-searches:
  1690.  
  1691.               very fast, no access to  the  hard-disk  needed  (once  the
  1692.             right index is loaded into  memory).  Only  possible  if  tag
  1693.             'SearchQuick' specified.
  1694.  
  1695.          2) indexed searches:
  1696.  
  1697.               fast, in most cases only one, short access to hd is needed;
  1698.             a few more in really bad situations. If the 'header'-file  is
  1699.             sufficiently  buffered,  no  accesses  to  the  hd may occur.
  1700.             Possible if searching for exact strings in indexed fields.
  1701.  
  1702.          3) other searches (non-indexed or patterns):
  1703.  
  1704.               slow, many data will have to be read from hd. If the  field
  1705.             searched  for  is  in  the  'header'-file  and  it's  heavily
  1706.             buffered,  no  accesses to the hd may occur. Nevertheless the
  1707.             search will consume much CPU-time.
  1708.  
  1709.          Search for status!!!
  1710.  
  1711.          Searching for a matching status only (i.e. not searching  for  a
  1712.        string) is always very fast.
  1713.  
  1714.          When doing non-indexed- or pattern-search, combine  with  status
  1715.        to reduce the amount of data to be searched through!
  1716.  
  1717.    SEE ALSO
  1718.        UMSSelect(), UMSReadMsg(), <ums.h>
  1719.  
  1720. ums.library/UMSSelect                                   ums.library/UMSSelect
  1721.  
  1722.    NAME
  1723.        UMSSelect -- Select messages.
  1724.  
  1725.    SYNOPSIS
  1726.        count = UMSSelect( login, tags )
  1727.         D0                 D2     D3
  1728.  
  1729.        LONG UMSSelect( UMSAccount, struct TagItem * );
  1730.  
  1731.        count = UMSSelectTags( login, tag1, ... )
  1732.  
  1733.        LONG UMSSelectTags( UMSAccount, ULONG, ... );
  1734.  
  1735.    FUNCTION
  1736.          Select  messages  in  the  MB according to various criteria.  To
  1737.        'select'  here means to set or unset some flags, which then can be
  1738.        used by UMSSearch(), stored, or transferred to another user.
  1739.  
  1740.          UMSSelect()  can  only  do  one operation upon every invocation.
  1741.        An  operation  usually  looks  for  all messages that fullfill the
  1742.        specified criteria and then selects them in a specified way.
  1743.  
  1744.          When  you  want  to  select  messages  by  different,  logically
  1745.        combined criteria, you may need to call UMSSelect() more than once
  1746.        and  use  some  temporary  flags.  However, very few calls to this
  1747.        functions usually should suffice.
  1748.  
  1749.    INPUTS
  1750.          The  following  tags  control  the selection of messages.  Thus,
  1751.        they somehow specify the 'output' of the select operation.
  1752.  
  1753.        SelWriteGlobal (none)
  1754.  
  1755.            manipulate global flags on the selected messages.
  1756.  
  1757.        SelWriteLocal (none)
  1758.  
  1759.            manipulate your local login-flags.
  1760.  
  1761.        SelWriteUser (STRPTR)
  1762.  
  1763.            manipulate another user's user-flags.  You  must  specify  the
  1764.          users name (or alias).
  1765.  
  1766.          SelWriteGlobal,  SelWriteLocal  and  SelWriteUser  are  mutually
  1767.        exclusive -- you can manipulate only one  flag-table  at  a  time.
  1768.        When  specifying  none  of  these  tags,  your  user-flags will be
  1769.        manipulated as default.
  1770.  
  1771.        SelSet,
  1772.        SelUnset (LONGBITS)
  1773.  
  1774.            on each selected message the 'SelUnset' flags are cleared  and
  1775.          then the 'SelSet' flags are set. ['status = (status & ~unset)  |
  1776.          set;']
  1777.  
  1778.            When writing global- or user-flags, you  are  not  allowed  to
  1779.          manipulate all possible flags. See <ums.h> for protected flags.
  1780.  
  1781.          The  following  tags control what and how messages are selected,
  1782.        the 'input' and 'modes' of the select operation.
  1783.  
  1784.        SelStart,
  1785.        SelStop (LONG)
  1786.  
  1787.            Limit the number of  messages  to  be  processed.  The  select
  1788.          operation will start with the message  indicated  by  'SelStart'
  1789.          and  stop before the 'SelStop' message. In other words, start is
  1790.          included and stop is excluded.
  1791.  
  1792.                (0 < start <= messages to be processed < stop)
  1793.  
  1794.            This was different and partly buggy in MBP versions  prior  to
  1795.          V10.16.
  1796.  
  1797.            If no 'SelStart' is specified, the operation starts  with  the
  1798.          first message; if no 'SelStop' is specified, the operation stops
  1799.          at the last existing message.
  1800.  
  1801.          The following operations are mutually exclusive:
  1802.  
  1803.      1) select by status
  1804.  
  1805.        SelReadGlobal (none)
  1806.        SelReadLocal  (none)
  1807.        SelReadUser   (STRPTR)
  1808.  
  1809.            like SelWriteGlobal, SelWriteLocal, SelWriteUser, but specifys
  1810.          which flags to look at. Again, your user-flags are the default.
  1811.  
  1812.        SelMask,
  1813.        SelMatch (LONGBITS)
  1814.  
  1815.            specify a mask and a  match.  If  (status  &  mask)  ==  match
  1816.          [status * mask = match], the message will be selected.
  1817.  
  1818.        SelParent (none)
  1819.  
  1820.            with this tag specified, each message's  'parent'  (reference;
  1821.          -> reply-chaining) will be inspected instead of its own status.
  1822.  
  1823.        SelMaxCount (LONG)
  1824.  
  1825.            this tag specifies a maximum number  of  messages  to  select.
  1826.          Even if there are more message with matching status,  only  that
  1827.          much  of them will be selected. Selects are done backwards, i.e.
  1828.          you'll get the last N matching messages.
  1829.  
  1830.        SelMaxSize (LONG)
  1831.  
  1832.            this tag specifies a maximum size for all  selected  messages.
  1833.          When selecting (from the end of the MB towards  the  beginning),
  1834.          the  selected  messages  sizes are summed up. If the sum exceeds
  1835.          the specified number bytes, the operation stops.
  1836.  
  1837.      2) select by date
  1838.  
  1839.        SelDate (LONG)
  1840.  
  1841.            the messages' dates are compared with the  supplied  date  (in
  1842.          seconds since 1.1.1978)  and  only  the  younger  ones  will  be
  1843.          selected.
  1844.  
  1845.      3) select by creation date
  1846.  
  1847.        SelCDate (LONG)
  1848.  
  1849.            the messages' creation dates are compared  with  the  supplied
  1850.          date (in seconds since 1.1.1978) and only the younger ones  will
  1851.          be selected.
  1852.  
  1853.            NOTE: binary creation date is an optional  field.  Only  those
  1854.          messages  that  have  this  field  can  be  selected  whit  this
  1855.          function!
  1856.  
  1857.      4) select a tree
  1858.  
  1859.        SelTree (LONG)
  1860.  
  1861.            you must specify the  number  of  a  message  here.  Then  all
  1862.          messages being in the same reply-tree will be selected.
  1863.  
  1864.      5) select a sub-tree
  1865.  
  1866.        SelSubTree (LONG)
  1867.  
  1868.            like SelTree, but only the subtree (the one with the specified
  1869.          message as its root) is selected.
  1870.  
  1871.      6) select a single message
  1872.  
  1873.        SelMsg (LONG)
  1874.  
  1875.            select only the specified message.
  1876.  
  1877.      7) select by text
  1878.  
  1879.        WMsgText, ..
  1880.        WMsgText + 127 (STRPTR)
  1881.  
  1882.  
  1883.            when you specify one of these tags, the function  selects  all
  1884.          messages which have the supplied string in the specified  field.
  1885.          The strings are compared case-INsensitive.
  1886.  
  1887.        SelQuick (none)
  1888.  
  1889.            when this tag is  specified,  'quick-search'  is  enabled  for
  1890.          selecting texts. This means that only some CRCs on the texts are
  1891.          compared.  This  makes  it  possible  to  select also some wrong
  1892.          messages. Yet, due to the usage of 32-bit CRCs, the  probability
  1893.          of  selecting  wrong  messages is VERY low, you most likely will
  1894.          never experience this case.
  1895.  
  1896.            As 'quick-search'  does  not  usually  need  to  access  mass-
  1897.          storage, it is VERY FAST.
  1898.  
  1899.      8) select by size
  1900.  
  1901.        SelSize (LONG)
  1902.  
  1903.            the messages' sizes are  compared  with  the  supplied  number
  1904.          (bytes) and only biggers ones will be selected.
  1905.  
  1906.    RESULT
  1907.        count - how many messages have been selected.  Zero, when no
  1908.                message has been selected or an error has occured.
  1909.  
  1910.    EXAMPLE
  1911.          See SelectMail.c for examples on how to use this function.
  1912.  
  1913.    NOTES
  1914.          Although  LONGBITS  are  used  in  the  definition,  the current
  1915.        implementation only uses/supports the lower 16 bits.
  1916.  
  1917.    SEE ALSO
  1918.        UMSSearch(), <ums.h>
  1919.  
  1920. ums.library/UMSServerControl                     ums.library/UMSServerControl
  1921.  
  1922.    NAME
  1923.  
  1924.        UMSServerControl -- control the UMS server.
  1925.  
  1926.    SYNOPSIS
  1927.  
  1928.        error = UMSServerControl(server, action)
  1929.          D0                       D2     D3
  1930.  
  1931.        UMSError UMSServerControl (STRPTR, LONG);
  1932.  
  1933.    FUNCTION
  1934.          This  function  does  not  take an UMS account as parameter, but
  1935.        simply the name of the server to address and an integer number for
  1936.        the action to the server is expected to perform. It "annonymously"
  1937.        controls the global behaviour of the server.
  1938.  
  1939.          The following actions are available:
  1940.  
  1941.        1 = CleanUp
  1942.  
  1943.            Start  the  cleanup  procedure,  reorganizing  the  whole  MB,
  1944.          physically deleting deleted and  expired  messages  and  freeing
  1945.          space  on  the HD. This procedure is critical, since the MB will
  1946.          be corrupted if the procedure is interrupted (by system failure,
  1947.          power-off,  reboot,  ..). Always make of backup of the MB before
  1948.          starting a cleanup! A cleanup is not possible if there are valid
  1949.          logins, since all message-numbers are changed.
  1950.  
  1951.        2 = Flush
  1952.  
  1953.            Flush all buffers.
  1954.  
  1955.        3 = Quit
  1956.  
  1957.            Terminate the server. If there still are  logins,  the  server
  1958.          might pop up a requester to ask whether to quit or to continue.
  1959.  
  1960.        4 = QuitForce
  1961.  
  1962.            Really terminate the server, no matter how  many  users  still
  1963.          need it. No requester.
  1964.  
  1965.        5 = Ping
  1966.  
  1967.            Test whether the addressed server is running.
  1968.  
  1969.        6 = LockCfg
  1970.  
  1971.            Globally lock the UMS configuration against changes.
  1972.  
  1973.        7 = UnlockCfg
  1974.  
  1975.            Release a lock optained with LockCfg. You should  use  LockCfg
  1976.          before and UnlockCfg after editing the file  "ums.config"  while
  1977.          the server is running.
  1978.  
  1979.    INPUTS
  1980.        server - name of the UMS server to control.
  1981.        action - number of action to perform.
  1982.  
  1983.    RESULT
  1984.        error - error number.
  1985.  
  1986.    SEE ALSO
  1987.        UMSErrTxt(), UMSErrNum()
  1988.  
  1989. ums.library/UMSWriteConfig                         ums.library/UMSWriteConfig
  1990.  
  1991.    NAME
  1992.        UMSWriteConfig -- Write an element to the UMS' configuration.
  1993.  
  1994.    SYNOPSIS
  1995.        success = UMSWriteConfig( login, tags )
  1996.          D0                       D2     D3
  1997.  
  1998.        BOOL UMSWriteConfig( UMSAccount, struct TagItem * );
  1999.  
  2000.        success = UMSWriteConfigTags( login, tag1, ... )
  2001.  
  2002.        BOOL UMSWriteConfigTags( UMSAccount, ULONG, ... );
  2003.  
  2004.  
  2005.    FUNCTION
  2006.          Create or modify elements of UMS' configuration.
  2007.  
  2008.    INPUTS
  2009.          The following tags are allowed:
  2010.  
  2011.          (Note: talking about a  'user' means  exporters  and  sysops  as
  2012.        well.)
  2013.  
  2014.        CfgData (STRPTR)
  2015.  
  2016.            this tag's data holds the  contents  of  the  variable  to  be
  2017.          written. Use this tag in conjunction with CfgName (see below).
  2018.  
  2019.        CfgUser (STRPTR)
  2020.  
  2021.            name of the user whose local configuration should be  changed.
  2022.          E.g. create a new alias or variable belonging to  the  specified
  2023.          user etc.
  2024.  
  2025.        CfgGlobalOnly (none)
  2026.  
  2027.            change an element  of  the  global  configuration  area  being
  2028.          readable by all users.
  2029.  
  2030.        CfgQuoted (LONG, V11)
  2031.  
  2032.            to store the variable's data in quoted format, allowing to mix
  2033.          the data  and  macro  definitions,  set  the  tag's  data  to  1
  2034.          otherwise set it to 0 (or do not use this tag).
  2035.  
  2036.        CfgLocal (none, V11)
  2037.  
  2038.            use this tag to create or delete variables that are only valid
  2039.          with the current login, disappearing after UMSLogout(). This way
  2040.          you  can  easily use UMSMatchConfig() without actually modifying
  2041.          the "ums.config".
  2042.  
  2043.        CfgUnlockVar (LONG, V11)
  2044.  
  2045.            use  this  tag  to  unlock  a  variable  locked   by   calling
  2046.          UMSReadConfig() with the CfgLockVar tag allowing "public" access
  2047.          again.  Set the tag's data to 1 to unlock and store the variable
  2048.          and its data, set it to 2 to just unlock  the  variable  without
  2049.          actually  saving  it  and set it to 0 (or don't use this tag) to
  2050.          not care about the current locking state of the variable.
  2051.  
  2052.  
  2053.          The following tags are mutually exclusive. Use  exactly  one  of
  2054.        them.
  2055.  
  2056.        CfgName (STRPTR)
  2057.  
  2058.            Name of the config variable to be changed. If  a  variable  of
  2059.          the given name does not exist it will be created.  To  remove  a
  2060.          variable  from  the  configuration  do not specify a tag CfgData
  2061.          (see above).
  2062.  
  2063.        CfgDump (STRPTR)
  2064.  
  2065.            write the current settings to a file with given name.
  2066.  
  2067.        CfgCreateAlias (STRPTR, V11)
  2068.  
  2069.            create a new alias of the given name for the user specified by
  2070.          the CfgUser tag (see above).
  2071.  
  2072.        CfgDeleteAlias (STRPTR, V11)
  2073.  
  2074.            remove the alias of the given name from the user specified  by
  2075.          the CfgUser tag (see above).
  2076.  
  2077.        CfgCreateExporter (STRPTR, V11)
  2078.  
  2079.            create a new export user with the given name.
  2080.  
  2081.        CfgCreateSysop (STRPTR, V11)
  2082.  
  2083.            create a new user with sysop-privilegs with the given name.
  2084.  
  2085.        CfgCreateUser (STRPTR, V11)
  2086.  
  2087.            create a new user with the given name.
  2088.  
  2089.        CfgDeleteUser (STRPTR, V11)
  2090.  
  2091.            remove the user with the given  name  from  the  configuration
  2092.          deleting her local variables as well.
  2093.  
  2094.        CfgAddNetGroup,
  2095.        CfgNetGroup (STRPTR, V11)
  2096.  
  2097.            add a netgroup entry. These two tags must  be  used  together,
  2098.          each naming one group. These two groups then are  considered  to
  2099.          the of the same "netgroup". If there are more than two named for
  2100.          the same netgroup, repeat  this  function  for  each  additional
  2101.          groupname,  setting  CfgNetGroup  to  the  name  of  an  already
  2102.          existing group.
  2103.  
  2104.        CfgDeleteNetGroup (STRPTR, V11)
  2105.  
  2106.            delete a netgroup entry. The named group will be removed  from
  2107.          the configuration.
  2108.  
  2109.  
  2110.    RESULT
  2111.        success - whether it was possible and allowed to make the desired
  2112.                  write or change.
  2113.  
  2114.    SEE ALSO
  2115.        UMSReadConfig()
  2116.  
  2117. ums.library/UMSWriteMsg                               ums.library/UMSWriteMsg
  2118.  
  2119.    NAME
  2120.        UMSWriteMsg -- write a message to the UMS message base.
  2121.  
  2122.    SYNOPSIS
  2123.        msgNum = UMSWriteMsg( login, tags )
  2124.          D0                   D3     D3
  2125.  
  2126.        LONG UMSWriteMsg( UMSAccount, struct TagItem * );
  2127.  
  2128.        msgNum = UMSWriteMsgTags( login, tag1, ... )
  2129.  
  2130.        LONG UMSWriteMsgTags( UMSAccount, ULONG, ... );
  2131.  
  2132.    FUNCTION
  2133.          Writes  a message to the UMS message base.  This may be either a
  2134.        new  message  to  create  or  an  already  existing  message to be
  2135.        changed.
  2136.  
  2137.          The  MBP  checks  correctness  of  the  message  and  the  users
  2138.        write-access  concerning  this message before writing it.  It also
  2139.        performs  dupe-checking,  tries to link to a tree of reply-chains,
  2140.        creates   all  desired  indices  and  computes  the  other  users'
  2141.        read-access to this message.
  2142.  
  2143.          All  the components of the message as well as information on how
  2144.        to do it are supplied as AmigaDOS compatible TagItems.
  2145.  
  2146.    INPUTS
  2147.          The following tags are allowed:
  2148.  
  2149.        WMsgText, ..
  2150.        WMsgText + 127 (STRPTR)
  2151.  
  2152.            specify a certain text-field.
  2153.  
  2154.            A text fields is always one null-terminated string.  Read  the
  2155.          separate documantation to see what fields and  what  formats  of
  2156.          these fields are allowed.
  2157.  
  2158.            A certain text-field (identified by its tag) may  only  appear
  2159.          once in a message. If a field is specified more than once in the
  2160.          tag list, only the latest will be used.
  2161.  
  2162.        WTextFields (UMSMsgTextFields)
  2163.  
  2164.            specify more than one text-field. This points to an  array  of
  2165.          UMSNUMFIELDS string-pointers.  All  fields  you  don't  want  to
  2166.          specify have to be NULL in this array.
  2167.  
  2168.  
  2169.        WMsgNum (LONG)
  2170.  
  2171.            when you want to change an old message, you must use this  tag
  2172.          to specify the number of the message to change. Don't  use  this
  2173.          tag when you just want to create a new message.
  2174.  
  2175.        WMsgDate (LONG)
  2176.  
  2177.            this has  a  very  special  meaning.  Specifying  an  AmigaDOS
  2178.          compatible date (seconds since 1.1.1978) with this tag indicates
  2179.          that  you  want  to  restore an old message from a backup rather
  2180.          than writing a new one. All users will have the 'old'  flag  set
  2181.          and not get this message as a new one when this tag is used.
  2182.  
  2183.        WChainUp (LONG)
  2184.  
  2185.            in some cases it might be unsure or impossible for the MBP  to
  2186.          build the correct reply-chain for a message.  Use  this  tag  to
  2187.          specify the number of the old message that is referred to by the
  2188.          new one.
  2189.  
  2190.        WHardLink,
  2191.        WSoftLink (LONG)
  2192.  
  2193.            Writing a message with a Message-ID that already exists in the
  2194.          MB usually will lead to the detection of a 'dupe'. Yet  in  some
  2195.          cases  it  is  necessary for UMS to allow multiple messages with
  2196.          the same Message-ID.
  2197.  
  2198.            This is made possible by the concept of message-'links'.  With
  2199.          this concept, multiple messages sharing the same Message-ID (and
  2200.          perhaps  some  more  fields)  are organized in a circular linked
  2201.          list. To create such a linked list, you  just  write  its  first
  2202.          message  as  usual  and  remember its number. Then you write the
  2203.          other messages using one of the above tags to specify the number
  2204.          of the original message (or any of the already linked messages).
  2205.  
  2206.            The MBP may optimize storage space for message links  by  only
  2207.          storing the fields  that  differ  between  the  fields  and  the
  2208.          original  message.  Nevertheless  you always have to specify the
  2209.          whole message to write a  link  and  you  will  always  get  the
  2210.          complete message when reading a link.
  2211.  
  2212.            All links to a message must consist of the same fields as  the
  2213.          original message, but the contents of the fields may differ.
  2214.  
  2215.            There are two sorts of message-links, hardlinks and softlinks.
  2216.          Softlinks describe messages that have some fields in common  (at
  2217.          least  MsgID),  but  are  really treated as individual messages.
  2218.          E.g. a mail with multiple receipients. Hardlinks, on  the  other
  2219.          hand,  are treated as one message wherever possible. I.e. if you
  2220.          read one hardlinked message, all the other links will be  marked
  2221.          as  old,  too.  RFC  crosspostings, for instance, should be made
  2222.          hardlinks.
  2223.  
  2224.        WAutoBounce (LONG)
  2225.  
  2226.            If the msg to be written is addressed to  a  local  user  that
  2227.          doesn't exist or to an address  that  no  exporter  can  export,
  2228.          there are two possible behaviours possible for the MBP:
  2229.  
  2230.            a) reject the message using error-no "NoReader", expecting the
  2231.               client to care about the undeliverable message
  2232.  
  2233.            b) keep the message, forwarding it to the local sysop or  some
  2234.               kind of 'bounce-daemon', so that the writing  client  needs
  2235.               not to care about the message any more.
  2236.  
  2237.            This tag allowes to  specify  the  desired  behaviour,  data=0
  2238.          forces a), data=1 forces b). If this tag is not  specified,  the
  2239.          MBP  will  choose the behaviour as it wishes, maybe depending on
  2240.          whether the writing user is an exporter or not.
  2241.  
  2242.        WHide (LONG)
  2243.  
  2244.            In some cases it might be desirable to write  a  message  that
  2245.          can only by read by exporters and not by simple  users,  or  the
  2246.          other way round.
  2247.  
  2248.            For instance control-messages that are of no interest to users
  2249.          by must be distributed over the net.
  2250.  
  2251.            Setting data to 0 is the same as  the  default.  data=1  means
  2252.          that only exporters may view and read the message, data=2  makes
  2253.          the message invisible to exporters and only accessible to simple
  2254.          users.
  2255.  
  2256.        WHdrFill,
  2257.        WTxtFill (LONG)
  2258.  
  2259.            specify how many bytes to reserve for  later  changes  in  the
  2260.          header/text of the message.
  2261.  
  2262.            The MBP may not be able to change an existing message  if  the
  2263.          change would increase the overall size (maybe after compression)
  2264.          of  the  message.  Since  such  changes  are  neccessary in some
  2265.          special cases, the MBP can be told to reserve  some  space  when
  2266.          writing a message the first time.
  2267.  
  2268.            Reserving more than actually needed is not a good idea,  since
  2269.          it decreases performance and  wastes  space.  The  writer  of  a
  2270.          message  usually  should  know whether or not he will change the
  2271.          message later on and to what extend he will increase the size of
  2272.          the message.
  2273.  
  2274.        WNoUpdate (LONG)
  2275.  
  2276.            when writing a message, the 'Old'-flag in your user-status for
  2277.          the new message will usually be set. If you don't want this, use
  2278.          this tag and set its data to 1.
  2279.  
  2280.        WCheckHeader (LONG)
  2281.  
  2282.            if you just want to check whether the MBP would likely  accept
  2283.          a message but you don't  yet  have  the  complete  body  of  the
  2284.          message,  you can use this tag und set its data to 1: nothing is
  2285.          actually written to the MB. If the supplied message-header seems
  2286.          to  be  ok, -1 will be returned as a "fake" message number. Then
  2287.          you can get the messages body (e.g. transfer it over a  network)
  2288.          and write the message with removing this tag of just setting its
  2289.          data to 0.
  2290.  
  2291.    RESULT
  2292.        msgNum - Number of the written message or NULL on failure.
  2293.  
  2294.    NOTES
  2295.          Changing an old message:
  2296.  
  2297.          You must _always_ give a complete message to UMSWriteMsg(), even
  2298.        when changing an old one! The MBP needs this to detect all changes
  2299.        made  to  the  old  message,  including  changed, added or deleted
  2300.        fields. Thus you need to read a message prior to changing it.  Use
  2301.        RTextFields and WTextField for UMSReadMsg() and UMSWriteMsg() when
  2302.        changing an old message! Otherwise you will lose fields unknown to
  2303.        your   application   that   might  be  still  important  to  other
  2304.        applications!
  2305.  
  2306.          You may not be allowed to change certain fields of  an  existing
  2307.        message. Most likely those fields that are  used  by  the  MBP  to
  2308.        compute all the users access-rights will be prohibited to change.
  2309.  
  2310.